package com.heima.wemedia.receive.page;

import com.heima.model.common.dtos.ResponseResult;

import java.io.Serializable;

public class PageResponseResult<T> extends ResponseResult<T> implements Serializable {
    private Long currentPage;
    private Long size;
    private Long total;

    public PageResponseResult(Long currentPage, Long size, Long total) {
        this.currentPage = currentPage;
        this.size = size;
        this.total = total;
    }

    public PageResponseResult() {

    }

    public static <T> PageResponseResult<T> okResult(Long currentPage, Long size, Long total, T data) {
        PageResponseResult<T> result = new PageResponseResult<>();
        result.setCurrentPage(currentPage);
        result.setSize(size);
        result.setTotal(total);
        result.setData(data);
        return result;
    }


    public Long getCurrentPage() {
        return currentPage;
    }

    public void setCurrentPage(Long currentPage) {
        this.currentPage = currentPage;
    }

    public Long getSize() {
        return size;
    }

    public void setSize(Long size) {
        this.size = size;
    }

    public Long getTotal() {
        return total;
    }

    public void setTotal(Long total) {
        this.total = total;
    }
}
